package br.net.woodstock.tickettoride.orm;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

@Entity
@Table(name = "ttr_application")
public class Application extends AbstractIntegerEntity {

	private static final long	serialVersionUID	= 8649892090785869894L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "application_id", unique = true)
	private Integer				id;

	@Column(name = "application_alias", length = 45, nullable = false)
	@NotNull
	@Size(min = 1, max = 45)
	private String				alias;

	@Column(name = "application_name", length = 100, nullable = false)
	@NotNull
	@Size(min = 1, max = 100)
	private String				name;

	@Column(name = "application_description", length = 255, nullable = false)
	@NotNull
	@Size(min = 1, max = 255)
	private String				description;

	@Column(name = "application_path", length = 255, nullable = false)
	@NotNull
	@Size(min = 1, max = 255)
	private String				path;

	@Column(name = "application_status", nullable = false)
	@Enumerated(EnumType.ORDINAL)
	@NotNull
	private ApplicationStatus	status;

	public Application() {
		super();
	}

	public Application(final Integer id) {
		super();
		this.id = id;
	}

	@Override
	public Integer getId() {
		return this.id;
	}

	@Override
	public void setId(final Integer id) {
		this.id = id;
	}

	public String getAlias() {
		return this.alias;
	}

	public void setAlias(final String alias) {
		this.alias = alias;
	}

	public String getName() {
		return this.name;
	}

	public void setName(final String name) {
		this.name = name;
	}

	public String getDescription() {
		return this.description;
	}

	public void setDescription(final String description) {
		this.description = description;
	}

	public String getPath() {
		return this.path;
	}

	public void setPath(final String path) {
		this.path = path;
	}

	public ApplicationStatus getStatus() {
		return this.status;
	}

	public void setStatus(final ApplicationStatus status) {
		this.status = status;
	}

}
